<div class="modal fade in ip-box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" id="edit">
    <div class="modal-dialog modal-lg" role="document" style="margin:254px auto;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel">应用管理 — 修改</h4>
            </div>
            <div class="modal-body">

                <form name="editForm">
                    
                    <div class="col-xs-12 col-sm-6">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right">名称：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text"
                                       name="appName"
                                       autocomplete="off" 
                                       class="form-control" 
                                       required
                                       ng-model="edit_appName"
                                       >
                                <label class="red required">*</label>
                                <div class="error ng-hide" ng-show="editForm.appName.$dirty &amp;&amp; editForm.appName.$invalid">
                                    <small class="error" ng-show="editForm.appName.$error.required">请输入名称</small>
                                </div>
                            </div>       
                        </div>
                         <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">唯一标识：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                       name="appKey"
                                       class="form-control"
                                       readonly  
                                       ng-model="edit_appKey"
                                       >
                            </div>       
                        </div>

                        <div class="form-group " >
                            <label class="col-xs-12 col-sm-3 control-label text-right">密钥：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                       name="appSecret"
                                       class="form-control" 
                                       readonly
                                       ng-model="edit_appSecret"
                                       >
                            </div>       
                        </div>

                        <div class="form-group" >
                            <label class="col-xs-12 col-sm-3 control-label text-right">图片：</label>
                            <div class="col-xs-12 col-sm-9">
                                <div class="input-group col-md-12 pull-right">
                                    <input type="text" 
                                           name="appImage" 
                                           class="form-control" 
                                           readonly 
                                           placeholder="请选择应用图片"
                                           ng-model="edit_appImage"
                                           >
                                    <span class="input-group-addon">选择</span>
                                </div>
                                <img ng-src="../images/header/user-img.png">
                            </div>  
                            <div class="overflow-hide app-img col-xs-12 col-sm-6">
                                <img ng-src="{{ edit_appImage }}">
                            </div>     
                        </div>

                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">应用类型：</label>
                            <div class="col-xs-12 col-sm-9">
                                <select name="appType" 
                                        ng-options="obj.id as obj.name for obj in editAppType" 
                                        ng-model="edit_appType"
                                        >
                                </select>
                                <div class="error ng-hide" ng-show="editForm.appType.$dirty &amp;&amp; editForm.appType.$invalid">
                                    <small class="error" ng-show="editForm.appType.$error.required">请选择应用类型</small>
                                </div>
                            </div>       
                        </div>
                       
                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">应用状态：</label>
                            <div class="col-xs-12 col-sm-9">
                                <select name="status"  
                                        ng-options="obj.id as obj.name for obj in editAppStatus" 
                                        ng-model="edit_status"
                                        >
                                </select>
                                <div class="error ng-hide" ng-show="editForm.status.$dirty &amp;&amp; editForm.status.$invalid">
                                    <small class="error" ng-show="editForm.status.$error.required">请选择应用状态</small>
                                </div>
                            </div>       
                        </div>
                    </div> 

                    <div class="col-xs-12 col-sm-6">
                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">URL：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                       name="appUri"
                                       autocomplete="off" 
                                       class="form-control" 
                                       required 
                                       ng-model="edit_appUri"
                                       >
                                <label class="red required">*</label>
                                <div class="error ng-hide" ng-show="editForm.appUri.$dirty &amp;&amp; editForm.appUri.$invalid">
                                    <small class="error" ng-show="editForm.appUri.$error.required">请输入URL</small>
                                </div>
                            </div>       
                        </div>

                        <div class="form-group ">
                            <label class="col-xs-12 col-sm-3 control-label text-right">IP地址：</label>
                            <div class="col-xs-12 col-sm-9">
                                <input type="text" 
                                       name="appIp"
                                       autocomplete="off" 
                                       class="form-control" 
                                       required 
                                       ng-model="edit_appIp"
                                       >
                                <label class="red required">*</label>
                                <div class="error ng-hide" ng-show="editForm.appIp.$dirty &amp;&amp; editForm.appIp.$invalid">
                                    <small class="error" ng-show="editForm.appIp.$error.required">请输入IP地址</small>
                                </div>
                            </div>       
                        </div>
                        
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-3 control-label text-right" >授权类型：</label>
                            <div class="col-xs-12 col-sm-9">
                                <div class="checkbox">
                                    <input type="checkbox"
                                           name="authType" 
                                           style="margin-left:0;" 
                                           ng-checked="true" 
                                           disabled 
                                           >
                                    <span style="margin-left:16px;">授权码Code</span>
                                </div>
                            </div>       
                        </div>

                    </div>

                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 control-label text-right">许可类型：</label>
                            <div class="col-xs-12 col-sm-10" style="padding-top:8px;">
                                
                                <div class="margin-top-zero checkbox col-xs-12 col-sm-3" ng-repeat="val in edit_authType">
                                    <input type="checkbox"
                                           name="sysValue" 
                                           ng-checked="isSelectedAuthType(val.sysVal)"
                                           ng-model="sysValState"
                                           ng-click="edit_getSysVal(sysValState, val.sysVal, $index)"
                                           >
                                    <span>{{ val.displayName }}</span>
                                </div>

                            </div>
                        </div>
                    </div>

                    <div class="col-xs-12 col-sm-12">
                    
                        <div class="form-group">
                            
                            <label class="col-xs-12 col-sm-2 control-label text-right">授权范围：</label>

                            <div class="col-xs-12 col-sm-10">

                                <fieldset class="field">
                                    <legend>
                                        <input type="checkbox"
                                               ng-model="edit_master0" 
                                               ng-checked="edit_isCheck0" 
                                               ng-mousedown="operationEdit()" 
                                               ng-click="selectAll(edit_master0, 0)"
                                               >
                                        <span>{{ edit_serviceTypeName0 }}</span>
                                    </legend>
                                    <div style="padding-left:30px">
                                        <div class="col-xs-6 col-sm-3" ng-repeat="val in edit_scopes0">
                                            <input type="checkbox"
                                                   ng-checked="{ true : edit_master0, false : isSelected0(val.scopesCode) }[isSelectedAll0]" 
                                                   ng-mousedown="operationEdit()" 
                                                   ng-click="select(val, bool, 0)"
                                                   ng-model="bool" 
                                                   >
                                            <span>{{ val.scopeName }}</span>
                                        </div>
                                    </div>
                                </fieldset>

                                <fieldset class="field">
                                    <legend>
                                        <input type="checkbox"
                                               ng-model="edit_master1"
                                               ng-checked="edit_isCheck1" 
                                               ng-mousedown="operationEdit()" 
                                               ng-click="selectAll(edit_master1, 1)"
                                               >
                                        <span>{{ edit_serviceTypeName1 }}</span>
                                    </legend>
                                    <div style="padding-left:30px">
                                        <div class="col-xs-6 col-sm-3" ng-repeat="val in edit_scopes1">
                                            <input type="checkbox"
                                                   ng-checked="{ true : edit_master1, false : isSelected1(val.scopesCode) }[isSelectedAll1]" 
                                                   ng-mousedown="operationEdit()" 
                                                   ng-click="select(val, bool, 1)"
                                                   ng-model="bool" 
                                                   >
                                            <span>{{ val.scopeName }}</span>
                                        </div>
                                    </div>
                                </fieldset>
                            </div>

                        </div>

                    </div>

                    <div class="col-xs-12 col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-12 col-sm-2 control-label text-right">简介：</label>
                            <div class="col-xs-12 col-sm-10">
                                <textarea rows="5" 
                                          type="text" 
                                          name="description" 
                                          class="form-control" 
                                          ng-model="edit_appSummary"
                                          >                                    
                                </textarea>
                                
                            </div>
                        </div>
                    </div>

                </form>

                <div class="col-sm-12">
                    <div class="modal-footer">
                        <button type="button" 
                                class="btn btn-primary" 
                                data-dismiss="modal" 
                                ng-disabled="editForm.$invalid||edit_hasSyaVal==0||edit_hasSelect==0"
                                ng-click="submitEdit()" 
                                >修改
                        </button>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>